<template>
  <f7-page class="main-bg-color">
    <h1 class="my-title">个人中心</h1>
    <div class="my-info-box main-linear-bg">
      <div class="top">
        <div class="left">
          <div>
            <p>动态等级</p>
            <div class="star-box">
              <img src="../../assets/wd_011.png" alt="" v-for="(item, index) in userInfo.user.namic_level" :key="index">
            </div>
          </div>
          <p>推荐人 {{userInfo.user.pid}}</p>
          <h2>{{userInfo.user.phone | phoneFilter}}</h2>
        </div>
        <div>
          <img v-if="userInfo.user.static_level" :src="require(`../../assets/level${userInfo.user.static_level}.png`)" alt="">
        </div>
      </div>
      <div class="bottom">
        <div>
          <p>建设金</p>
          <p>{{userInfo.money.paidan_f}}</p>
        </div>
        <div>
          <p>收益积分</p>
          <p>{{userInfo.money.shouyi_f}}</p>
        </div>
        <div>
          <p>激活币</p>
          <p>{{userInfo.money.jihuo_f}}</p>
        </div>
      </div>
    </div>

    <f7-list>
      <f7-list-item title="收款资料" link="/collection-information/"></f7-list-item>
      <f7-list-item title="业绩查询" link="/performance-inquiry/"></f7-list-item>
      <f7-list-item title="我的客服" link="/my-customer-service/"></f7-list-item>
      <f7-list-item title="安全中心" link="/security-center/"></f7-list-item>
      <f7-list-item title="系统设置" link="/setting/"></f7-list-item>
      <f7-list-item title="版本号" link></f7-list-item>
      <f7-list-item title="退出登录" link @click="logout"></f7-list-item>
    </f7-list>
  </f7-page>
</template>

<script>
  export default {
    name: "my",
    computed: {
      userInfo() {
        return this.$store.getters.userInfo
      }
    },
    methods: {
      logout() {
        this.$dialog.confirm({
          title: '提示',
          message: '确定要退出登录吗？',
          confirmButtonColor: 'red',
          confirmButtonText: '退出'
        }).then(() => {
          this.$store.dispatch('LogOut')
        }).catch(() => {

        })
      }
    }
  }
</script>

<style scoped lang="scss">
  .main-bg-color {
    padding: 42px;
  }
  .star-box {
    display: flex;
    img {
      width: 30px!important;
      height: 30px!important;
    }
  }

  .my-title {
    font-size: 40px;
    color: $mainColor;
  }
  .my-info-box {
    border-radius: $radius;
    margin: 10px 0;
    padding: 30px;
    color: $fontColor;
    .top {
      display: flex;
      justify-content: space-between;
      .left {
        flex: 1;
        > div {
          display: flex;
          align-items: center;
        }
      }
      img {
        width: 88px;
        height: auto;
      }
      h2 {
        font-size: 40px;
        margin-top: 20px;
      }
    }
    .bottom {
      display: flex;
      margin-top: 20px;
      > div {
        flex: 1;
        padding-left: 30px;
        &:nth-child(1) {
          padding: 0;
        }
        &:nth-child(2) {
          border-left: 1px solid $fontColor;
          border-right: 1px solid $fontColor;
        }
      }
    }
  }
</style>